package com.stone.persistent.recyclerview.adapter.viewholder;

import android.content.Context;
import android.view.View;

import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;

import com.stone.persistent.recyclerview.R;
import com.stone.persistent.recyclerview.adapter.MenuPagerAdapter;
import com.stone.persistent.recyclerview.widget.ViewPagerIndicator;

import org.jetbrains.annotations.NotNull;


public class MenuViewHolder extends RecyclerView.ViewHolder {

    public MenuViewHolder(@NotNull View itemView, @NotNull Context activity) {
        super(itemView);
        ViewPager2 viewPager2 = (ViewPager2)itemView.findViewById(R.id.home_menu_viewpager2);
        viewPager2.setOffscreenPageLimit(2);
        viewPager2.setAdapter(new MenuPagerAdapter((FragmentActivity)activity));
        ViewPagerIndicator var3 = (ViewPagerIndicator)itemView.findViewById(R.id.home_menu_indicator);
        var3.setViewPager2(viewPager2, 2);
    }
}